﻿using Microsoft.EntityFrameworkCore;
using SqliteDAL.Model;
using Utilities;

namespace SqliteDAL
{
    public class MyContext : DbContext
    {
        public virtual DbSet<Login> Login { get; set; }
        protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
        {
            //string conn = ConfigurationHelper.GetConnectionString("ConnectionString", "config.json");
            string conn = "Data Source=mydatabase.db";
            optionsBuilder.UseSqlite(conn);
            base.OnConfiguring(optionsBuilder);
        }

        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            base.OnModelCreating(modelBuilder);
            modelBuilder.ApplyConfigurationsFromAssembly(this.GetType().Assembly);
        }
    }
}
